package com.sinaapp.gavinzhang.GSpider.plugin.selector;

import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

/**
 * 不用再判断是否为null
 * Created by Gavin on 2015-12-01.
 */
public class GSelector {
    public static Elements selectElements(Elements elements){
        if ((elements==null) || (elements.size()==0)){
            return null;
        }else {
            return elements;
        }
    }

    public static Element selectElement(Element element){
        if (element != null){
            return element;
        }else {
            return null;
        }
    }

    public static Element selectElement(Elements elements){
        if ((elements==null) || (elements.size()==0)){
            return null;
        }else {
            return elements.get(0);
        }
    }
}
